package com.chennan.leading.service;

import com.chennan.leading.common.distributedno.AbstractGenerateNoBasic;
import com.chennan.leading.common.distributedno.model.BasicGenerateNoParam;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @author chennan
 * @createTime 2022年03月24日 17:36:00
 */
@Service
public class TestGenerateNo extends AbstractGenerateNoBasic {

    @Override
    protected Long findNoLasted(LocalDateTime startTime, LocalDateTime endTime) {
        return 88L;
    }

    @Override
    protected BasicGenerateNoParam generateDistributedLockKey() {
        return BasicGenerateNoParam.builder().redisKeyNo("test1111")
                .prefix("LLAAATEST").distributedLockKey("testrediskey").build();
    }

    public String testGenerateNo(){
        return this.generateNo();
    }
}
